home *** CD-ROM | disk | FTP | other *** search
/ APDL Other Worlds / APDL Other Worlds Collection.iso / SF3000 / Extras / CBlibrary / h / ErrNotRec < prev    next >
Encoding:
Text File  |  2003-09-11  |  2.0 KB  |  61 lines

  1. /*
  2.  * CBLibrary - err
  3.  * Copyright (C) 2003  Chris Bazley
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Lesser General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2.1 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Lesser General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Lesser General Public
  16.  * License along with this library; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  */
  19.  
  20. /* Original version by Tony Houghton for !FormText
  21.  
  22.   Applications using this component need the following messages:
  23.   FatErr, NewErr, OldErr, ErrButtons
  24.  */
  25.  
  26. #ifndef err_h
  27. #define err_h
  28.  
  29. #include <stdbool.h>
  30. #include "kernel.h"
  31.  
  32. #define err_check_fatal(func) { \
  33.                                 _kernel_oserror *er = func; \
  34.                                 if(er != NULL) { \
  35.                                   err_check_fatal_rep(er); \
  36.                                 } \
  37.                               }
  38. #define RE(func) { \
  39.                    _kernel_oserror *er = func; \
  40.                    if(er != NULL) { \
  41.                      err_check_rep(er); \
  42.                    } \
  43.                  }
  44.  
  45. #define EF(func) err_check_fatal(func)
  46.  
  47. #define E(func) err_check(func)
  48.  
  49. extern void err_set_taskname(const char *name, bool new_errs);
  50.  
  51. extern bool err_check(const _kernel_oserror *);
  52. extern void err_check_rep(const _kernel_oserror *);
  53. extern void err_check_fatal_rep(const _kernel_oserror *);
  54.  
  55. extern void err_report(int, const char *);    /* OK button only */
  56. extern void err_complain(int, const char *);    /* Cancel & OK buttons */
  57. extern void err_complain_fatal(int, const char *);    /* Cancel button only */
  58. extern void err_box_die(_kernel_oserror *);
  59.  
  60. #endif
  61.